Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/improve unit testing setup #1090

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
Tests/config.ini

# Translations
*.mo
Expand Down Expand Up @@ -157,4 +158,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
.idea/
30 changes: 28 additions & 2 deletions Tests/_readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,41 @@

- Use a TM1 development environment

- In `Tests` folder: Copy the file `config.ini.template` with the new name `config.ini`

- Specify your instance coordinates in the config.ini file as `tm1srv01`

- `EnableSandboxDimension` config parameter must be set to `F` for the target TM1 instance

# Run TM1py Tests

## To run all tests with PyCharm:
## Run tests via commandline

### To run all tests

On Windows:

`pytest .\Tests\`

On Linux and macOS:

`pytest ./Tests/`

### To run a specific test file from the `Tests` folder

On Windows:

`pytest .\Tests\ChoreService_test.py`

On Linux and macOS:

`pytest ./Tests/ChoreService_test.py`

## Run tests via PyCharm

### To run all tests

rightclick `Tests` folder -> run 'pytest in Tests'

## To run tests in a given file in the `Tests` folder:
## To run a specific test file from the `Tests` folder:
rightclick file (e.g., `ChoreService_test.py`) -> run 'pytest in ChoreService_test.py'
File renamed without changes.