Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: tools/telemetry/third_party/coverage/tests/goldtest.py

Issue 1366913004: Add coverage Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
3
4 """A test base class for tests based on gold file comparison."""
5
6 import os
7 import sys
8
9 from tests.coveragetest import CoverageTest
10
11 from coverage.test_helpers import change_dir # pylint: disable=unused-import
12 from tests.test_farm import clean
13 # Import helpers, eventually test_farm.py will go away.
14 from tests.test_farm import ( # pylint: disable=unused-import
15 compare, contains, doesnt_contain, contains_any,
16 )
17
18
19 class CoverageGoldTest(CoverageTest):
20 """A test based on gold files."""
21
22 run_in_temp_dir = False
23
24 def setUp(self):
25 super(CoverageGoldTest, self).setUp()
26 self.chdir(self.root_dir)
27 # Modules should be importable from the current directory.
28 sys.path.insert(0, '')
29
30 def output_dir(self, the_dir):
31 """Declare where the output directory is.
32
33 The output directory is deleted at the end of the test, unless the
34 COVERAGE_KEEP_OUTPUT environment variable is set.
35
36 """
37 self.addCleanup(self.cleanup_output_dir, the_dir)
38
39 def cleanup_output_dir(self, the_dir):
40 """Clean up the output directory of the test."""
41 if not os.environ.get("COVERAGE_KEEP_OUTPUT"): # pragma: partial
42 clean(the_dir)
OLDNEW
« no previous file with comments | « tools/telemetry/third_party/coverage/tests/farm/run/src/xxx ('k') | tools/telemetry/third_party/coverage/tests/helpers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698