Skip to main content

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):

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)

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

tester_button = tk.Button(frame, text="PyBEN Tester", width=20,
      command=lambda root_obj=root: start_pybentester(root_obj))

Metadata

Release files for pybentest 3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybentest 3.0
File Size Uploaded
pybentest-3.0.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pybentest 3.0
File Interpreter ABI Platform
pybentest-3.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / pybentest-3.0.tar.gz

Download URL pybentest-3.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9f17d0833433fa0dd85af3ee6fc1e376a72aa2c60fbb71f650c77eb199283967
BLAKE2b-256 checksum
How to use checksums
e081862d274fa4ce178f482a55680d0491c13dffcf018caa28aecec08825da91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.5

Release files / pybentest-3.0-py3-none-any.whl

Download URL pybentest-3.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf96a7d8795006cff78f5cbada37db235aba7b4a8bdc9f652f1cc94b5ec955cf
BLAKE2b-256 checksum
How to use checksums
dae46e8cf60a87af3dc8f3ebf7e4306561958b9a59dc5472c8d275b9ba31750d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

3.0 This release

2 release files

2.2

1 release file

2.0

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page