Skip to content

Commit ebcf07e

Browse files
committed
Fix build
1 parent 33e4c73 commit ebcf07e

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ When unit tests are being run as part of CI or as a normal guard against regress
110110

111111
The normal procedure for writing a sample based unit test is to just write the test as if the sample already exists, then running the test with `--sample-ask` and viewing and approving the resulting sample, which is then automatically written to a file. The sample file name is displayed, making it easy to find the file in order to add it to tracking so that it can be committed along with the test module.
112112

113-
When working on large changes that cause many samples to become outdated, reviewing and approving samples can be deferred until the new code approaches stability. This is done by running the tests with `--sample-write`, which automatically writes or updates samples to match the current results. Then, view and approve the tests with `--sample-review` before committing.
113+
When working on large changes that cause many samples to become outdated, reviewing and approving samples can be deferred until the new code approaches stability. This is done by running the tests with `--sample-update`, which automatically writes or updates samples to match the current results. Then, view and approve the tests with `--sample-review` before committing.
114114

115115
Typically, it is not desirable to track generated files in Git. However, although the sample files are generated, they are an integral part of the units tests, and should be tracked just like the unit tests themselves.
116116

conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ def pytest_addoption(parser):
8181
help='Prompt to update or write new test sample files on failures'
8282
)
8383
parser.addoption(
84-
'--sample-write', action='store_true',
84+
'--sample-update', action='store_true',
8585
help='Automatically update or write sample files on failures'
8686
)
8787
parser.addoption(
8888
'--sample-review', action='store_true',
89-
help='Review samples (use after --sample-write)'
89+
help='Review samples (use after --sample-update)'
9090
)
9191
parser.addoption(
9292
'--sample-tidy', action='store_true',

gmn/src/d1_gmn/tests/test_templates.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
from __future__ import absolute_import
2525

26+
import freezegun
2627
import responses
2728

2829
import d1_gmn.tests.gmn_test_case
@@ -37,6 +38,7 @@
3738

3839

3940
@d1_test.d1_test_case.reproducible_random_decorator('TestTemplates')
41+
@freezegun.freeze_time('1961-11-22')
4042
class TestTemplates(d1_gmn.tests.gmn_test_case.GMNTestCase):
4143
@responses.activate
4244
def test_1000(self):

test_utilities/src/d1_test/sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def assert_equals(
101101
format(filename, '-' * 10, diff_str)
102102
)
103103

104-
if pytest.config.getoption('--sample-write'):
104+
if pytest.config.getoption('--sample-update'):
105105
save(got_str, filename)
106106
return
107107

test_utilities/src/d1_test/test_docs/test_templates_home_html_doc.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
</tr>
8888
<tr>
8989
<td>Operations, last hour:</td>
90-
<td>632</td>
90+
<td>3,236</td>
9191
</tr>
9292
<tr>
9393
<td>Subjects:</td>
@@ -99,7 +99,7 @@
9999
</tr>
100100
<tr>
101101
<td>Server time:</td>
102-
<td>Dec. 7, 2017, 4:19 p.m.</td>
102+
<td>Nov. 22, 1961, midnight</td>
103103
</tr>
104104
<tr>
105105
<td>Storage used / remaining:</td>

0 commit comments

Comments
 (0)