Skip to content

Commit

Permalink
Remove sleep, use os.stat
Browse files Browse the repository at this point in the history
  • Loading branch information
nwiltsie committed Jun 24, 2024
1 parent cefe680 commit c7e8da9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nftest/NFTestAssert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""NF Test assert"""

import datetime
import os
import subprocess
from typing import Callable, Optional
from logging import getLogger, DEBUG
Expand Down Expand Up @@ -51,7 +52,7 @@ def perform_assertions(self):

# Assert that the actual file was updated during this test run
file_mod_time = datetime.datetime.fromtimestamp(
actual_path.stat().st_mtime, tz=datetime.timezone.utc
os.stat(actual_path).st_mtime, tz=datetime.timezone.utc
)

self._logger.debug("Test creation time: %s", self.startup_time)
Expand Down
2 changes: 0 additions & 2 deletions test/unit/test_NFTestAssert.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import logging
import stat
import textwrap
import time

import pytest

Expand Down Expand Up @@ -134,7 +133,6 @@ def fixture_configured_test(
)

if file_updated and actual_file is not None:
time.sleep(0.1)
actual_file.write_bytes(actual_file.read_bytes())

return assertion
Expand Down

0 comments on commit c7e8da9

Please sign in to comment.