Skip to content

Commit

Permalink
Introduce artificial delay into test_gettext_dont_rebuild_mo
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jul 20, 2023
1 parent 13720de commit ce140e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_intl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import os
import re
import time

import pygments
import pytest
Expand Down Expand Up @@ -629,6 +630,7 @@ def get_number_of_update_targets(app_):
# phase1: build document with non-gettext builder and generate mo file in srcdir
app0 = make_app('dummy', *args, **kwargs)
app0.build()
time.sleep(0.01)
assert (app0.srcdir / 'xx' / 'LC_MESSAGES' / 'bom.mo').exists()
# Since it is after the build, the number of documents to be updated is 0
assert get_number_of_update_targets(app0) == 0
Expand All @@ -646,6 +648,7 @@ def get_number_of_update_targets(app_):
# The mo file in the srcdir directory is retained.
app = make_app('gettext', *args, **kwargs)
app.build()
time.sleep(0.01)
# Since it is after the build, the number of documents to be updated is 0
assert get_number_of_update_targets(app) == 0
# Even if the timestamp of the mo file is updated, the number of documents
Expand Down

0 comments on commit ce140e8

Please sign in to comment.