|
4 | 4 | import re |
5 | 5 | import sys |
6 | 6 | import unittest |
7 | | -from test.test_decimal import skip_expected |
| 7 | +from types import SimpleNamespace |
8 | 8 | from textwrap import dedent |
9 | 9 | from pathlib import Path |
10 | 10 |
|
@@ -519,38 +519,35 @@ def test_parse_keyword_spec(self): |
519 | 519 |
|
520 | 520 | def test_normalize_multiline(self): |
521 | 521 | # required to set up normalize |
522 | | - class NormOptions: |
523 | | - width = 78 |
| 522 | + options = SimpleNamespace(width=78) |
524 | 523 | make_escapes(True) |
525 | 524 |
|
526 | 525 | s = 'multi-line\n translation' |
527 | 526 | s_expected = '""\n"multi-line\\n"\n" translation"' |
528 | 527 |
|
529 | | - data = normalize(s, 'UTF-8', NormOptions) |
| 528 | + data = normalize(s, 'UTF-8', options) |
530 | 529 | self.assertEqual(s_expected, data) |
531 | 530 |
|
532 | 531 | def test_normalize_wrap(self): |
533 | 532 | # required to set up normalize |
534 | | - class NormOptions: |
535 | | - width = 30 |
| 533 | + options = SimpleNamespace(width=30) |
536 | 534 | make_escapes(True) |
537 | 535 |
|
538 | 536 | s = 'this string should be wrapped to 30 chars' |
539 | 537 | s_expected = '""\n"this string should be wrapped "\n"to 30 chars"' |
540 | 538 |
|
541 | | - data = normalize(s, 'UTF-8', NormOptions) |
| 539 | + data = normalize(s, 'UTF-8', options) |
542 | 540 | self.assertEqual(s_expected, data) |
543 | 541 |
|
544 | 542 | def test_normalize_nostr(self): |
545 | 543 | # required to set up normalize |
546 | | - class NormOptions: |
547 | | - width = 78 |
| 544 | + options = SimpleNamespace(width=30) |
548 | 545 | make_escapes(True) |
549 | 546 |
|
550 | 547 | s = '' |
551 | 548 | s_expected = '""' |
552 | 549 |
|
553 | | - data = normalize(s, 'UTF-8', NormOptions) |
| 550 | + data = normalize(s, 'UTF-8', options) |
554 | 551 | self.assertEqual(s_expected, data) |
555 | 552 |
|
556 | 553 |
|
|
0 commit comments