Conditions | 2 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """Collection of tests around character encodings.""" |
||
11 | @pytest.mark.skipif(not PY3, reason='Only necessary on Python3') |
||
12 | def test_not_ascii(): |
||
13 | """Make sure that the systems preferred encoding is not `ascii`. |
||
14 | |||
15 | Otherwise `click` is raising a RuntimeError for Python3. For a detailed |
||
16 | description of this very problem please consult the following gist: |
||
17 | https://gist.github.com/hackebrot/937245251887197ef542 |
||
18 | |||
19 | This test also checks that `tox.ini` explicitly copies the according |
||
20 | system environment variables to the test environments. |
||
21 | """ |
||
22 | try: |
||
23 | preferred_encoding = locale.getpreferredencoding() |
||
24 | fs_enc = codecs.lookup(preferred_encoding).name |
||
25 | except Exception: |
||
26 | fs_enc = 'ascii' |
||
27 | assert fs_enc != 'ascii' |
||
28 |