Skip to content

Commit a566e11

Browse files
committed
refact(win_errs): move HIDE_WINDOWS_KNOWN_ERRORS from main-code to test
1 parent 61ea9bb commit a566e11

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

gitdb/test/__init__.py

+10
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@
22
#
33
# This module is part of GitDB and is released under
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
5+
import os
6+
7+
from gitdb.util import is_win
8+
9+
10+
#: We need an easy way to see if Appveyor TCs start failing,
11+
#: so the errors marked with this var are considered "acknowledged" ones, awaiting remedy,
12+
#: till then, we wish to hide them.
13+
HIDE_WINDOWS_KNOWN_ERRORS = is_win and os.environ.get('HIDE_WINDOWS_KNOWN_ERRORS', True)
14+

gitdb/test/db/test_pack.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
import os
1515
import random
16-
from gitdb.util import mman, HIDE_WINDOWS_KNOWN_ERRORS
16+
from gitdb.util import mman
17+
from gitdb.test import HIDE_WINDOWS_KNOWN_ERRORS
1718

1819

1920
class TestPackDB(TestDBBase):

gitdb/test/lib.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# This module is part of GitDB and is released under
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55
"""Utilities used in ODB testing"""
6+
#{ Bases
7+
68
from array import array
79
from functools import wraps
810
import gc
@@ -16,12 +18,12 @@
1618
import tempfile
1719
import unittest
1820

19-
from gitdb import OStream
20-
from gitdb.util import rmtree, mman, HIDE_WINDOWS_KNOWN_ERRORS
21+
from gitdb.base import OStream
22+
from gitdb.test import HIDE_WINDOWS_KNOWN_ERRORS
23+
from gitdb.util import rmtree, mman
2124
from gitdb.utils.compat import xrange
2225

2326

24-
#{ Bases
2527
log = logging.getLogger(__name__)
2628

2729

@@ -168,7 +170,7 @@ def make_bytes(size_in_bytes, randomize=False):
168170
return a.tostring()
169171

170172

171-
def make_object(type, data):
173+
def make_object(otype, data):
172174
""":return: bytes resembling an uncompressed object"""
173175
odata = "blob %i\0" % len(data)
174176
return odata.encode("ascii") + data

gitdb/util.py

-5
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ def unpack_from(fmt, data, offset=0):
8484

8585
log = logging.getLogger(__name__)
8686

87-
#: We need an easy way to see if Appveyor TCs start failing,
88-
#: so the errors marked with this var are considered "acknowledged" ones, awaiting remedy,
89-
#: till then, we wish to hide them.
90-
HIDE_WINDOWS_KNOWN_ERRORS = is_win and os.environ.get('HIDE_WINDOWS_KNOWN_ERRORS', True)
91-
9287
#{ compatibility stuff ...
9388

9489

0 commit comments

Comments
 (0)