From 8c4c899ef95c9d9f61ceec5b56692f3839940cb4 Mon Sep 17 00:00:00 2001 From: askeing Date: Thu, 14 Apr 2016 16:13:48 +0800 Subject: [PATCH] Modified the servo_tidy_tests for both "./mach" and "make test" - fix `cd python/tidy; make test` fail issue --- python/tidy/Makefile | 4 +--- python/tidy/servo_tidy_tests/test_tidy.py | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/tidy/Makefile b/python/tidy/Makefile index b047dea9a8f..33f3b499fc8 100644 --- a/python/tidy/Makefile +++ b/python/tidy/Makefile @@ -16,9 +16,7 @@ dev-env: $(VENV)/bin/python # for testing .PHONY: test test: dev-env - $(VENV)/bin/pip install --upgrade funcsigs - $(VENV)/bin/pip install --upgrade mock - $(VENV)/bin/python -m unittest discover -s tests -v + $(VENV)/bin/python -m unittest discover -s servo_tidy_tests -v .PHONY: clean diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py index f49f6d9a23d..d0e19daafb1 100644 --- a/python/tidy/servo_tidy_tests/test_tidy.py +++ b/python/tidy/servo_tidy_tests/test_tidy.py @@ -7,12 +7,14 @@ # option. This file may not be copied, modified, or distributed # except according to those terms. +import os import unittest from servo_tidy import tidy def iterFile(name): - return iter(['python/tidy/servo_tidy_tests/' + name]) + path = 'servo_tidy_tests/' if os.path.exists('servo_tidy_tests/') else 'python/tidy/servo_tidy_tests/' + return iter([os.path.join(path, name)]) class CheckTidiness(unittest.TestCase):