mirror of
https://github.com/datahub-project/datahub.git
synced 2025-06-27 05:03:31 +00:00
48 lines
1.2 KiB
Python
48 lines
1.2 KiB
Python
# Copyright 2021 Acryl Data, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
import logging
|
|
import os
|
|
import time
|
|
|
|
import pytest
|
|
|
|
try:
|
|
# See https://github.com/spulec/freezegun/issues/98#issuecomment-590553475.
|
|
import pandas # noqa: F401
|
|
except ImportError:
|
|
pass
|
|
|
|
# Enable debug logging.
|
|
logging.getLogger().setLevel(logging.DEBUG)
|
|
os.putenv("DATAHUB_DEBUG", "1")
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_time(monkeypatch):
|
|
def fake_time():
|
|
return 1615443388.0975091
|
|
|
|
monkeypatch.setattr(time, "time", fake_time)
|
|
|
|
yield
|
|
|
|
|
|
def pytest_addoption(parser):
|
|
parser.addoption(
|
|
"--update-golden-files",
|
|
action="store_true",
|
|
default=False,
|
|
)
|