File tree 3 files changed +18
-27
lines changed
3 files changed +18
-27
lines changed Original file line number Diff line number Diff line change @@ -3,19 +3,17 @@ Testing
3
3
4
4
First, install tox into your virtualenv::
5
5
6
- pip install -U tox
6
+ pip install --upgrade tox
7
7
8
- To run all the qrcode tests, you'll need to install the older Python
9
- interpreters. Here's how you'll do it on a modern Ubuntu distribution::
8
+ To run all tests, you'll need to install multiple Python interpreters. On a
9
+ modern Ubuntu distribution you can use ``add-apt-repository
10
+ ppa:deadsnakes/ppa ``.
10
11
11
- sudo add-apt-repository ppa:deadsnakes/ppa
12
- sudo apt-get update
13
- sudo apt-get install python2.4-dev python2.6-dev
12
+ Depending on if you can install the wheels directly for your OS, you may need
13
+ the libraries to build PIL, too. Here's the Ubuntu commands::
14
14
15
- Ensure you have the libraries to build PIL, too::
16
-
17
- sudo apt-get install build-essential python-dev python3-dev
15
+ sudo apt-get install build-essential python-dev python3-dev
18
16
sudo apt-get install libjpeg8-dev zlib1g-dev
19
17
20
18
Finally, just run ``tox ``!
21
- If you want, you can test against a specific version like this: ``tox -e py33 ``
19
+ If you want, you can test against a specific version like this: ``tox -e py36 ``
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ def test_stdin_py3_unicodedecodeerror(self, mock_print_ascii):
47
47
mock_stdin .buffer .read .return_value = 'testtext'
48
48
mock_stdin .read .side_effect = bad_read
49
49
with mock .patch ('sys.stdin' , mock_stdin ):
50
+ # sys.stdin.read() will raise an error...
51
+ self .assertRaises (UnicodeDecodeError , sys .stdin .read )
52
+ # ... but it won't be used now.
50
53
main ([])
51
54
mock_print_ascii .assert_called_with (tty = True )
52
55
Original file line number Diff line number Diff line change 1
1
[tox]
2
2
distribute = False
3
3
envlist =
4
- coverage_setup,
5
- py26, py27, py33, py34,
6
- readme,
4
+ coverage_setup
5
+ py{27,34,35,36}
6
+ readme
7
7
coverage_report
8
+ skip_missing_interpreters = True
8
9
9
10
[testenv]
10
11
usedevelop = True
@@ -13,22 +14,10 @@ deps =
13
14
pillow
14
15
git+git://github.com/ojii/pymaging.git# egg=pymaging
15
16
git+git://github.com/ojii/pymaging-png.git# egg=pymaging-png
17
+ py27: mock
16
18
commands =
17
19
{envbindir}/coverage run -a --source qrcode -m unittest {posargs:discover qrcode}
18
20
19
- [testenv:py27]
20
- deps =
21
- {[testenv]deps}
22
- mock
23
-
24
- [testenv:py26]
25
- deps =
26
- {[testenv:py27]deps}
27
- unittest2
28
- lxml
29
- commands =
30
- {envbindir}/coverage run -a --source qrcode {envbindir}/unit2 {posargs:discover qrcode}
31
-
32
21
[testenv:readme]
33
22
deps =
34
23
docutils
47
36
coverage
48
37
commands =
49
38
coverage html
50
- coverage report --fail-under =90 -m
39
+ coverage report --include =" qrcode/tests/*" --fail-under =100 -m
40
+ coverage report --omit =" qrcode/tests/*" --fail-under =90 -m
You can’t perform that action at this time.
0 commit comments