# 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))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/DarkFlameBEN/pybentest.git",
"name": "pybentest",
"maintainer": null,
"docs_url": null,
"requires_python": ">3",
"maintainer_email": null,
"keywords": null,
"author": "Ben Moskovitch",
"author_email": "\"Ben Moskovitch\" <darkflameben@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e0/81/862d274fa4ce178f482a55680d0491c13dffcf018caa28aecec08825da91/pybentest-3.0.tar.gz",
"platform": null,
"description": "# PyBen-Test\r\nAlternative Testing Module\r\n\r\n## PyBEN Tester\r\nTester application helping find and execute test files with an easy-to-use GUI\r\n\r\n### Installation:\r\n\r\n pip install pybentest \r\n\r\n### Arguments:\r\n directory: Root directory of test files\r\n module: Locate test files in a python module instead of directory\r\n regex: Regex to match test files (default='**/test_*.py')\r\n prefix: python module to execute each test file with (default='pytest')\r\n args: Arguments to pass to each test file execution\r\n\r\n### Execution function (easy to understand):\r\n \r\n```python\r\n\r\nfor i in self.selected_files:\r\n main_args = [sys.executable, '-m'] + self.prefix.split() + [' ', i, ' '] + self.suffix.split()\r\n subprocess.run(main_args)\r\n```\r\n### Use cases:\r\nShow ArgParser info:\r\n\r\n python -m pybentest.tester -h\r\n\r\nDefault: Find and execute pytest files under the current working directory:\r\n\r\n python -m pybentest.tester\r\n\r\nFind and execute pytest files under a different directory:\r\n\r\n python -m pybentest.tester -d \r\n\r\nFind and execute pytest files under a specific python module (if the module has pytest files inside it):\r\n\r\n python -m pybentest.tester -m <module name>\r\n\r\nYou can also pass extra arguments like '--junitxml=utput.xml':\r\n\r\n python -m pybentest.tester -a --junitxml=utput.xml\r\n python -m pybentest.tester -a \"--junitxml=utput.xml --alluredir=allure-results\"\r\n\r\n### Embed PyBentester in your own TK application\r\n\r\nThis will open a new window with all the test files in the search parameters (root_dir / module)\r\n```python\r\nfrom pybentest.tester import PyBenTester\r\n\r\ndef start_pybentester(root_obj):\r\n toplevel = tk.Toplevel(root_obj)\r\n toplevel.geometry(\"1400x1000\") # If you want to set the size\r\n PyBenTester(parent_window=toplevel,\r\n root_dir='.',\r\n module='',\r\n regex='**/test_*.py',\r\n prefix='pytest',\r\n suffix='')\r\n```\r\nYou can start the function from a button inside your current TK application\r\n```python\r\ntester_button = tk.Button(frame, text=\"PyBEN Tester\", width=20,\r\n command=lambda root_obj=root: start_pybentester(root_obj))\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "PyBEN Alternative Testing Module",
"version": "3.0",
"project_urls": {
"Homepage": "https://github.com/DarkFlameBEN/pybentest.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dae46e8cf60a87af3dc8f3ebf7e4306561958b9a59dc5472c8d275b9ba31750d",
"md5": "5fd19ed73396b4e230901caea5f2f774",
"sha256": "bf96a7d8795006cff78f5cbada37db235aba7b4a8bdc9f652f1cc94b5ec955cf"
},
"downloads": -1,
"filename": "pybentest-3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5fd19ed73396b4e230901caea5f2f774",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">3",
"size": 6645,
"upload_time": "2025-02-08T16:41:23",
"upload_time_iso_8601": "2025-02-08T16:41:23.257671Z",
"url": "https://files.pythonhosted.org/packages/da/e4/6e8cf60a87af3dc8f3ebf7e4306561958b9a59dc5472c8d275b9ba31750d/pybentest-3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e081862d274fa4ce178f482a55680d0491c13dffcf018caa28aecec08825da91",
"md5": "4cdae0a00a45f1811a0bbf905f9e131a",
"sha256": "9f17d0833433fa0dd85af3ee6fc1e376a72aa2c60fbb71f650c77eb199283967"
},
"downloads": -1,
"filename": "pybentest-3.0.tar.gz",
"has_sig": false,
"md5_digest": "4cdae0a00a45f1811a0bbf905f9e131a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">3",
"size": 6158,
"upload_time": "2025-02-08T16:41:24",
"upload_time_iso_8601": "2025-02-08T16:41:24.275539Z",
"url": "https://files.pythonhosted.org/packages/e0/81/862d274fa4ce178f482a55680d0491c13dffcf018caa28aecec08825da91/pybentest-3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-08 16:41:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DarkFlameBEN",
"github_project": "pybentest",
"github_not_found": true,
"lcname": "pybentest"
}