From a885c54d54e71a089b916502f1c222ef14a07a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 15 Aug 2022 10:41:40 +0200 Subject: [PATCH] Fix the tests --- tests/test_sphinx_prompt.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_sphinx_prompt.py b/tests/test_sphinx_prompt.py index 47d16c5..6a31798 100644 --- a/tests/test_sphinx_prompt.py +++ b/tests/test_sphinx_prompt.py @@ -1,3 +1,7 @@ +from io import StringIO + +import docutils.statemachine +import docutils.utils import pytest sphinx_prompt = __import__("sphinx_prompt") @@ -150,6 +154,12 @@ def test(arguments, options, content, expected): sphinx_prompt._cache.next_index = 1 sphinx_prompt._cache.prompts.clear() - directive = sphinx_prompt.PromptDirective("prompt", arguments, options, content, 0, 0, "", None, None) + stream = StringIO() + reporter = docutils.utils.Reporter("test data", 2, 4, stream, 1) + statemachine = docutils.statemachine.StateMachine([], None) + setattr(statemachine, "reporter", reporter) + directive = sphinx_prompt.PromptDirective( + "prompt", arguments, options, content, 0, 0, "", None, statemachine + ) result = directive.run() assert result[0].astext() == expected 091ead1dfa24662df02cd0929ad8'>commitdiff
path: root/tests/cache.scm
AgeCommit message (Expand)Author
2022-06-04cache: Catch invalid 'last-expiry-cleanup'....Fixes <http://issues.guix.gnu.org/55638>. * guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: Use 'get-string-all' + 'string->number' instead of 'read'; ignore invalid numbers. * tests/cache.scm ("maybe-remove-expired-cache-entries, empty cache") ("maybe-remove-expired-cache-entries, corrupted cache"): New tests. Co-authored-by: Ludovic Courtès <ludo@gnu.org> zimoun
2020-03-22Remove workaround for 'time-monotonic' in Guile 2.2.2....This is a followup to e688c2df3924423b67892cc9939ca099c729d1cb. * build-aux/hydra/evaluate.scm <top level>: Remove 'time-monotonic' definition. * guix/cache.scm: Likewise. * guix/progress.scm: Likewise. * guix/scripts/substitute.scm: Likewise. * guix/scripts/weather.scm: Likewise. * tests/cache.scm: Likewise. Ludovic Courtès