• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openbraininstitute / neurodamus / 13517334888
90%

Build:
DEFAULT BRANCH: main
Ran 25 Feb 2025 08:59AM UTC
Jobs 2
Files 48
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Feb 2025 08:58AM UTC coverage: 57.696% (-0.01%) from 57.707%
13517334888

push

github

web-flow
Testing framework: set working directory to pytest "tmp_path" and create the tmp simulation config file (#76)

## Context
A simulation run usually generates output files in the following
locations:
- next to the simulation config file: ​*.SUCCESS file, reports that
under "output_dir" set in the simulation_config.json​
- in the working directory: log files, load balance folder, memory
usaged files

The current unit/scientific tests use the repo folder as the working
directory, therefore they create many unused output files in the repo.
This PR sets the working directory to a temp location per test function
using the pytest fixture `monkeypatch.chdir` and `tmp_path`

## Scope

- In `tests/conftest.py`: add the fixture `change_test_dir` that calls
`monkeypatch.chdir(tmp_path)` with `autouse=True`. `tmp_path`fixture
provides a temporary directory unique to each test function. All test
functions under `tests/` will automatically change to its `tmp_path` as
working directory.
- In `tests/conftest.py`, add the fixture
`create_tmp_simulation_config_file` that creates a simulation config
file in request in the `tmp_path` location with the content in request,
fixes the relative paths, and meanwhile updates the with the
`extra_config` content in request
- Adapt the current tests to use the `create_tmp_simulation_config_file`
fixture so that the test config files are in `tmp_path` controlled by
pytest.

## Testing
All tests.

## Review
* [x] PR description is complete
* [x] Coding style (imports, function length, New functions, classes or
files) are good
* [x] Unit/Scientific test added
* [x] Updated Readme, in-code, developer documentation

5233 of 9070 relevant lines covered (57.7%)

0.82 hits per line

Subprojects
ID Flag name Job ID Ran Files Coverage
1 baseline 13517334888.1 25 Feb 2025 08:59AM UTC 48
24.27
GitHub Action Run
2 unit 13517334888.2 25 Feb 2025 08:59AM UTC 48
57.31
GitHub Action Run
Source Files on build 13517334888
  • Tree
  • List 48
  • Changed 0
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #13517334888
  • bdf47a7c on github
  • Prev Build on main (#13500938159)
  • Next Build on main (#13520822572)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc