Skip to content

Commit

Permalink
refact(win_errs): move HIDE_WINDOWS_KNOWN_ERRORS from main-code to test
Browse files Browse the repository at this point in the history
  • Loading branch information
ankostis committed Oct 25, 2016
1 parent 61ea9bb commit 9b489f6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
10 changes: 10 additions & 0 deletions gitdb/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
import os

from gitdb.util import is_win


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

3 changes: 2 additions & 1 deletion gitdb/test/db/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

import os
import random
from gitdb.util import mman, HIDE_WINDOWS_KNOWN_ERRORS
from gitdb.util import mman
from gitdb.test import HIDE_WINDOWS_KNOWN_ERRORS


class TestPackDB(TestDBBase):
Expand Down
6 changes: 3 additions & 3 deletions gitdb/test/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
from gitdb.test import HIDE_WINDOWS_KNOWN_ERRORS
"""Utilities used in ODB testing"""
from array import array
from functools import wraps
Expand All @@ -16,8 +17,7 @@
import tempfile
import unittest

from gitdb import OStream
from gitdb.util import rmtree, mman, HIDE_WINDOWS_KNOWN_ERRORS
from gitdb.util import rmtree, mman
from gitdb.utils.compat import xrange


Expand Down Expand Up @@ -168,7 +168,7 @@ def make_bytes(size_in_bytes, randomize=False):
return a.tostring()


def make_object(type, data):
def make_object(otype, data):
""":return: bytes resembling an uncompressed object"""
odata = "blob %i\0" % len(data)
return odata.encode("ascii") + data
Expand Down
5 changes: 0 additions & 5 deletions gitdb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ def unpack_from(fmt, data, offset=0):

log = logging.getLogger(__name__)

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

#{ compatibility stuff ...


Expand Down

0 comments on commit 9b489f6

Please sign in to comment.