diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-12-13 14:14:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 14:14:49 -0700 |
commit | 3fe2d9d2627fc0f84aeed293ff8afa7c1f08d899 (patch) | |
tree | 2ea27fe06a19c39e8d7a5fe2f87cb7e05363247d /numpy/polynomial/tests/test_printing.py | |
parent | 7d7e446fcbeeff70d905bde2eb0264a797488280 (diff) | |
parent | eff302e5e8678fa17fb3d8156d49eb585b0876d9 (diff) | |
download | numpy-3fe2d9d2627fc0f84aeed293ff8afa7c1f08d899.tar.gz |
Merge branch 'master' into fix-issue-10244
Diffstat (limited to 'numpy/polynomial/tests/test_printing.py')
-rw-r--r-- | numpy/polynomial/tests/test_printing.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/numpy/polynomial/tests/test_printing.py b/numpy/polynomial/tests/test_printing.py index 27a8ab9f2..4e9902a69 100644 --- a/numpy/polynomial/tests/test_printing.py +++ b/numpy/polynomial/tests/test_printing.py @@ -85,7 +85,7 @@ class TestStrUnicodeSuperSubscripts: class TestStrAscii: @pytest.fixture(scope='class', autouse=True) - def use_unicode(self): + def use_ascii(self): poly.set_default_printstyle('ascii') @pytest.mark.parametrize(('inp', 'tgt'), ( @@ -161,7 +161,10 @@ class TestStrAscii: class TestLinebreaking: - poly.set_default_printstyle('ascii') + + @pytest.fixture(scope='class', autouse=True) + def use_ascii(self): + poly.set_default_printstyle('ascii') def test_single_line_one_less(self): # With 'ascii' style, len(str(p)) is default linewidth - 1 (i.e. 74) @@ -283,19 +286,19 @@ def test_nonnumeric_object_coefficients(coefs, tgt): class TestFormat: def test_format_unicode(self): - poly.Polynomial._use_unicode = False + poly.set_default_printstyle('ascii') p = poly.Polynomial([1, 2, 0, -1]) assert_equal(format(p, 'unicode'), "1.0 + 2.0·x¹ + 0.0·x² - 1.0·x³") def test_format_ascii(self): - poly.Polynomial._use_unicode = True + poly.set_default_printstyle('unicode') p = poly.Polynomial([1, 2, 0, -1]) assert_equal( format(p, 'ascii'), "1.0 + 2.0 x**1 + 0.0 x**2 - 1.0 x**3" ) def test_empty_formatstr(self): - poly.Polynomial._use_unicode = False + poly.set_default_printstyle('ascii') p = poly.Polynomial([1, 2, 3]) assert_equal(format(p), "1.0 + 2.0 x**1 + 3.0 x**2") assert_equal(f"{p}", "1.0 + 2.0 x**1 + 3.0 x**2") |