Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
remove old hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakuyume committed Mar 12, 2019
1 parent 1bc72b3 commit 54347c1
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .pfnci/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,6 @@ gsutil -q cp gs://chainercv-pfn-public-ci/datasets-tiny.zip ${TEMP}/
unzip -q ${TEMP}/datasets-tiny.zip -d ${TEMP}/
rm ${TEMP}/datasets-tiny.zip

set +x
# rename tests for pytest-xdist
for TEST in $(find tests/ -name '*.py')
do
cat - << 'EOD' >> ${TEST}
def rename_tests(module_name):
import inspect
import re
import sys
import unittest
module = sys.modules[module_name]
for name, cls in inspect.getmembers(module, inspect.isclass):
if not issubclass(cls, unittest.TestCase):
continue
delattr(module, name)
new_name = re.sub(r'(?s)_{.+}', '', name)
new_cls = type(new_name, (cls,), {})
setattr(module, new_name, new_cls)
rename_tests(__name__)
EOD
done
set -x

docker run --interactive --rm \
--volume $(pwd):/chainercv/ --workdir /chainercv/ \
--volume ${TEMP}/.chainer/:/root/.chainer/ \
Expand Down

0 comments on commit 54347c1

Please sign in to comment.