Skip to content

Commit 9b489f6

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

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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+
from gitdb.test import HIDE_WINDOWS_KNOWN_ERRORS
56
"""Utilities used in ODB testing"""
67
from array import array
78
from functools import wraps
@@ -16,8 +17,7 @@
1617
import tempfile
1718
import unittest
1819

19-
from gitdb import OStream
20-
from gitdb.util import rmtree, mman, HIDE_WINDOWS_KNOWN_ERRORS
20+
from gitdb.util import rmtree, mman
2121
from gitdb.utils.compat import xrange
2222

2323

@@ -168,7 +168,7 @@ def make_bytes(size_in_bytes, randomize=False):
168168
return a.tostring()
169169

170170

171-
def make_object(type, data):
171+
def make_object(otype, data):
172172
""":return: bytes resembling an uncompressed object"""
173173
odata = "blob %i\0" % len(data)
174174
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)