summaryrefslogtreecommitdiff
path: root/dev-python/Babel/files/Babel-2.9.0-pypy3.patch
blob: 45d50f5ff0b7fad07099b2252c8bfb563ed548c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From a291ee5da29fb9767ce8dc5f94e3fa19908f2596 Mon Sep 17 00:00:00 2001
From: Keri Volans <keri.volans@gmail.com>
Date: Sun, 10 May 2020 18:43:58 +0100
Subject: [PATCH] tests/test_dates.py: Fix broken test

datetime was being incorrectly patched, so the unittest was failing

Closes https://github.com/python-babel/babel/issues/675
---
 tests/test_dates.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/test_dates.py b/tests/test_dates.py
index 5be0d16a..3cd70d3e 100644
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
@@ -761,7 +761,6 @@ def test_zh_TW_format():
 
 
 def test_format_current_moment(monkeypatch):
-    import datetime as datetime_module
     frozen_instant = datetime.utcnow()
 
     class frozen_datetime(datetime):
@@ -771,7 +770,7 @@ def utcnow(cls):
             return frozen_instant
 
     # Freeze time! Well, some of it anyway.
-    monkeypatch.setattr(datetime_module, "datetime", frozen_datetime)
+    monkeypatch.setattr(dates, "datetime_", frozen_datetime)
     assert dates.format_datetime(locale="en_US") == dates.format_datetime(frozen_instant, locale="en_US")