Metadata-Version: 2.2
Name: pybentest
Version: 3.0
Summary: PyBEN Alternative Testing Module
Home-page: https://github.com/DarkFlameBEN/pybentest.git
Author: Ben Moskovitch
Author-email: "Ben Moskovitch" <darkflameben@gmail.com>
License: MIT License
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >3
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-python
Dynamic: summary

# PyBen-Test
Alternative Testing Module

## PyBEN Tester
Tester application helping find and execute test files with an easy-to-use GUI

### Installation:

    pip install pybentest    

### Arguments:
    directory: Root directory of test files
    module: Locate test files in a python module instead of directory
    regex: Regex to match test files (default='**/test_*.py')
    prefix: python module to execute each test file with (default='pytest')
    args: Arguments to pass to each test file execution

### Execution function (easy to understand):
    
```python

for i in self.selected_files:
    main_args = [sys.executable, '-m'] + self.prefix.split() + [' ', i, ' '] + self.suffix.split()
    subprocess.run(main_args)
```
### Use cases:
Show ArgParser info:

    python -m pybentest.tester -h

Default: Find and execute pytest files under the current working directory:

    python -m pybentest.tester

Find and execute pytest files under a different directory:

    python -m pybentest.tester -d 

Find and execute pytest files under a specific python module (if the module has pytest files inside it):

    python -m pybentest.tester -m <module name>

You can also pass extra arguments like '--junitxml=utput.xml':

    python -m pybentest.tester -a --junitxml=utput.xml
    python -m pybentest.tester -a "--junitxml=utput.xml --alluredir=allure-results"

### Embed PyBentester in your own TK application

This will open a new window with all the test files in the search parameters (root_dir / module)
```python
from pybentest.tester import PyBenTester

def start_pybentester(root_obj):
    toplevel = tk.Toplevel(root_obj)
    toplevel.geometry("1400x1000")  # If you want to set the size
    PyBenTester(parent_window=toplevel,
                root_dir='.',
                module='',
                regex='**/test_*.py',
                prefix='pytest',
                suffix='')
```
You can start the function from a button inside your current TK application
```python
tester_button = tk.Button(frame, text="PyBEN Tester", width=20,
      command=lambda root_obj=root: start_pybentester(root_obj))
```
