Skip to content

Commit 5374d23

Browse files
Merge pull request #2 from BenjamenMeyer/bugfix_fix-pep8
Bugfix fix pep8
2 parents 1d93486 + 23ff9b9 commit 5374d23

File tree

7 files changed

+57
-3
lines changed

7 files changed

+57
-3
lines changed

.coveragerc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[report]
2+
fail_under = 100
3+
exclude_lines =
4+
# Have to re-enable the standard pragma
5+
pragma: no cover
6+
7+
# Don't complain if tests don't hit defensive assertion code:
8+
raise NotImplementedError
9+
10+
[run]
11+
omit = *tests*
12+
branch = True

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: python
2+
matrix:
3+
include:
4+
- python: "2.7"
5+
env: TEST_SUITE=suite_2_7 TOX_ENV=py27
6+
- python: "pypy"
7+
env: TEST_SUITE=suite_pypy TOX_ENV=pypy
8+
- python: "3.4"
9+
env: TEST_SUITE=suite_3_4 TOX_ENV=py34
10+
- python: "3.5"
11+
env: TEST_SUITE=suite_3_5 TOX_ENV=py35
12+
- python: "3.4"
13+
env: TEST_SUITE=suite_3_4 TOX_ENV=pep8
14+
15+
before_install:
16+
- sudo apt-get install build-essential python-dev
17+
18+
install: pip install tox setuptools virtualenv coveralls --upgrade
19+
20+
script: tox -v -e $TOX_ENV -- -v
21+
22+
after_success: coveralls
23+
24+
notifications:
25+
email:
26+
- bm_witness@yahoo.com
27+

pyinstance/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ def __del__(self):
6666
if self.__session in PyInstance.pyinstances:
6767
# Decrement the reference counter
6868
PyInstance.pyinstances[self.__session][PyInstance.__COUNTER] = (
69-
PyInstance.pyinstances[self.__session][PyInstance.__COUNTER] - 1
69+
PyInstance.pyinstances[
70+
self.__session][PyInstance.__COUNTER] - 1
7071
)
7172

7273
# If zero, clear out the session from the instances dict
73-
if not PyInstance.pyinstances[self.__session][PyInstance.__COUNTER]:
74+
if not (
75+
PyInstance.pyinstances[self.__session][PyInstance.__COUNTER]
76+
):
7477
del PyInstance.pyinstances[self.__session]

tests/requires.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
nose2
2+
nose2-cov
23
six

tests/test_derived.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_derived_multiple(self):
6060
pyinstance.PyInstance.pyinstances[k]['instance'],
6161
DerivedInstance
6262
)
63+
v.__del__()
6364

6465
def test_derived_repeats(self):
6566
session_names = [
@@ -75,7 +76,7 @@ def test_derived_repeats(self):
7576
id(v)
7677
for k, v in six.iteritems(sessions)
7778
]
78-
79+
7980
self.assertEqual(
8081
len(session_names),
8182
len(ids)

tests/test_direct.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def test_direct_multiple(self):
5252
pyinstance.PyInstance.pyinstances[k]['instance'],
5353
pyinstance.PyInstance
5454
)
55+
v.__del__()
5556

5657
def test_direct_repeats(self):
5758
session_names = [
@@ -89,3 +90,6 @@ def test_direct_repeats(self):
8990
pyinstance.PyInstance.pyinstances[s]['instance'],
9091
pyinstance.PyInstance
9192
)
93+
94+
for k, v in six.iteritems(sessions):
95+
v.__del__()

unittest.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[coverage]
2+
always-on = True
3+
coverage = pyinstance
4+
coverage-report = html
5+
term-missing
6+
term

0 commit comments

Comments
 (0)