Skip to main content

PyBEN Alternative Testing Module

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybentest-3.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybentest-3.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pybentest-3.0.tar.gz.

File metadata

  • Download URL: pybentest-3.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for pybentest-3.0.tar.gz
Algorithm Hash digest
SHA256 9f17d0833433fa0dd85af3ee6fc1e376a72aa2c60fbb71f650c77eb199283967
MD5 4cdae0a00a45f1811a0bbf905f9e131a
BLAKE2b-256 e081862d274fa4ce178f482a55680d0491c13dffcf018caa28aecec08825da91

See more details on using hashes here.

File details

Details for the file pybentest-3.0-py3-none-any.whl.

File metadata

  • Download URL: pybentest-3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for pybentest-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf96a7d8795006cff78f5cbada37db235aba7b4a8bdc9f652f1cc94b5ec955cf
MD5 5fd19ed73396b4e230901caea5f2f774
BLAKE2b-256 dae46e8cf60a87af3dc8f3ebf7e4306561958b9a59dc5472c8d275b9ba31750d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page