google / google/openhtf

Unit tests need to be independent

Open
#592 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
722
Forks
237
Avg merge
11h 31m
Merged PRs (30d)
4

Description

There's a couple of issues here, at least one of which needs to be fixed:
1. Unit test modules are imported together (?) and then run, resulting in potentially unpleasant interactions depending on things happening at import time, and the order in which the tests are run.
2. The conf module hacks its own import, replacing itself with a global class instance. Changes made to this by any one module persist into all others.

I saw this when I was running measurements_test by itself, which failed; but running it through tox results in a pass because expectations have been set based on the fact that some other test does something to conf (this is really bad).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.