Skip to content

[ENH]: Test suite #38

Description

@adrybakov

Hello!

While making #37 I realised that there is no clear test suite for the TB2J.

If there is some, please correct me.

I propose the following strategy using pytest + hypothesis for the discussion:

  • Folder "utest" in the root folder (or other name with "test" in it)
  • Inside "utest" folder the files and folder repeat the structure of the "TB2J" folder from the root folder.
  • Each file and folder in the "utest" starts from the "test_"
  • Each file and folder in the "utest" contains unit tests for the corresponding functions and classes of the package.
  • Each function in the "utest" starts with "test_" and
  • Each class in "utest" starts with "Test"
  • Each class and function in the "utest" has the name of the class or function from the package for which it is written (if applicable).

With this strategy the tests can be run with the command from the root folder (after pip install pytest hypothesis):

pytest -s 

Example:

root/
├── ...
├── TB2J/
│   ├── file1.py
│   │   ├──> def function_1():
│   │   └──> class MyClass:
│   ├── submodule/
│   │   └── file2.py
│   │       └──> def function_2():
│   └── ...
├── utest/
│   ├── test_file1.py
│   │   ├──> def test_function_1_behaviour():
│   │   ├──> def test_function_1_raises():
│   │   └──> class TestMyClass:
│   ├── test_submodule/
│   │   └── test_file2.py
│   │       └──> def test_function_2():
│   └── ...
└── ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions