
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
libfaketime-tz-wrapper
Advanced tools
A wrapper around python-libfaketime that introduces timezone-awareness.
A wrapper around python-libfaketime <https://github.com/simon-weber/python-libfaketime>
__
that introduces awareness for (django) timezones.
Install with pip:
.. code-block:: sh
$ pip install libfaketime-tz-wrapper
libfaketime needs the LD_PRELOAD variable to be set.
If you run your tests in PyCharm, add it to the environment variables of your test configuration in PyCharm:
.. code-block::
name: LD_PRELOAD
value: /home/foo/<snip>/vendor/libfaketime/src/libfaketime.so.1
If you run tests in the command line, export this environment variable when running the test command:
.. code-block:: sh
$ LD_PRELOAD=/home/foo/<snip>/vendor/libfaketime/src/libfaketime.so.1 <run test command>
In both cases, replace the part with the correct path to where the libfaketime package was installed.
.. code-block:: python
import datetime
from libfaketime import fake_time
def get_tomorrow():
return datetime.date.today() + datetime.timedelta(days=1)
@fake_time('2014-01-01 00:00:00')
def test_get_tomorrow():
assert get_tomorrow() == datetime.date(2014, 1, 2)
FAQs
A wrapper around python-libfaketime that introduces timezone-awareness.
We found that libfaketime-tz-wrapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.