Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46a725b

Browse files
mdboomtonysyu
authored andcommitted
Clear style settings between tests
Conflicts: lib/matplotlib/tests/test_style.py Conflicts: lib/matplotlib/tests/test_style.py
1 parent 7ac26ee commit 46a725b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/tests/test_style.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def temp_style(style_name, settings=None):
3333
yield
3434
finally:
3535
shutil.rmtree(tempdir)
36+
style.reload_library()
3637

3738

3839
def test_available():
@@ -43,15 +44,14 @@ def test_available():
4344
def test_use():
4445
mpl.rcParams[PARAM] = 'gray'
4546
with temp_style('test', DUMMY_SETTINGS):
46-
style.use('test')
47-
assert mpl.rcParams[PARAM] == VALUE
47+
with style.context('test'):
48+
assert mpl.rcParams[PARAM] == VALUE
4849

4950

5051
def test_use_url():
5152
with temp_style('test', DUMMY_SETTINGS):
52-
style.use('https://gist.github.com/adrn/6590261/raw')
53-
54-
assert mpl.rcParams['axes.facecolor'] == "#adeade"
53+
with style.context('https://gist.github.com/adrn/6590261/raw'):
54+
assert mpl.rcParams['axes.facecolor'] == "#adeade"
5555

5656

5757
def test_context():

0 commit comments

Comments
 (0)