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

Don't mutate global state at import time in a test module #1222

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

mdickinson
Copy link
Member

We're mutating global state at import time in a test module, potentially leading to test interactions and test dependence on import order. This PR fixes the test to mutate at setUp time instead, and undo that mutation at tearDown.

Fixes #1220.

Copy link
Contributor

@kitchoi kitchoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mdickinson mdickinson merged commit 24345a1 into master Jun 29, 2020
@mdickinson mdickinson deleted the fix/mutation-of-global-state-in-tests branch June 29, 2020 11:34
@mdickinson
Copy link
Member Author

Thanks for reviewing!

mdickinson added a commit that referenced this pull request Jul 21, 2020
mdickinson added a commit that referenced this pull request Jul 21, 2020
* Fix end-year in copyright statement (#1198)

(cherry picked from commit 21e2a99)

* Fix trait-documenter extension tests for Sphinx 3.1 (#1206)

(cherry picked from commit aeaf72f)

* DOC/FIX: User manual mentioning a nonexisting feature in metadata filter (#1207)

* Fix user manual erroneously mentioning a nonexisting feature

* Fix grammar

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
(cherry picked from commit 3e78a41)

* Spelling and grammar. (#1210)

(cherry picked from commit 24c4d76)

* Fix description in README to match the one in the setup script (#1219)

(cherry picked from commit a5dc3f2)

* Fix some missing stubs (#1204)

* Add a couple of missing imports to api.pyi

* Remove mis-spelled stubs file

* Add missing api.pyi stubs for the has_traits module

* Add CTrait

* Add imports for BaseTraitHandler and TraitHandler

* Add constants

(cherry picked from commit 47806c8)

* Standardize copyright years (#1227)

* Standardize copyright years

* Use hard-coded year in conf.py, for ease of later search-and-replace. Also normalise punctuation.

* More punctuation OCD

* More consistency fixes

* Remove unused import

* Remove the _right_ unused import

* Yet one more consistency fix

(cherry picked from commit aa63531)

* Don't mutate global state at import time in a test module (#1222)

(cherry picked from commit 24345a1)

* Fix typo in optional_dependencies (#1235)

Fix a comment that mistakenly refers to traits.api, when it means traitsui.api.

(cherry picked from commit a48ede5)

* Update PyPI links and capitalization in README.rst (#1250)

* Update PyPI links and capitalization in README.rst

This PR:
- updates incorrect and inconsistent capitalization in the README
- adds a PyPI link for Sphinx
- adds a PyPI link for the Enthought Sphinx Theme (the previous link was to GitHub)

* Clarify that later versions  of Sphinx are fine

* Update README.rst

(cherry picked from commit 8d03955)

* Update changelog

Co-authored-by: Kit Choi <kitchoi@users.noreply.github.com>
@mdickinson mdickinson added porting: backported to 6.1 This PR has been backported to the Traits 6.1.x release branch and removed porting: needs backport to 6.1 labels Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
porting: backported to 6.1 This PR has been backported to the Traits 6.1.x release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_interface_checker mutates global state
2 participants