@@ -598,17 +598,10 @@ def test_integer_values_and_tz_interpreted_as_utc(self):
598
598
# but UTC is *not* deprecated.
599
599
with tm .assert_produces_warning (None ):
600
600
result = DatetimeIndex (values , tz = "UTC" )
601
- expected = DatetimeIndex (["2000-01-01T00:00:00" ], tz = "US/Central" )
601
+ expected = DatetimeIndex (["2000-01-01T00:00:00" ], tz = "UTC" )
602
+ tm .assert_index_equal (result , expected )
602
603
603
604
def test_constructor_coverage (self ):
604
- rng = date_range ("1/1/2000" , periods = 10.5 )
605
- exp = date_range ("1/1/2000" , periods = 10 )
606
- tm .assert_index_equal (rng , exp )
607
-
608
- msg = "periods must be a number, got foo"
609
- with pytest .raises (TypeError , match = msg ):
610
- date_range (start = "1/1/2000" , periods = "foo" , freq = "D" )
611
-
612
605
msg = r"DatetimeIndex\(\.\.\.\) must be called with a collection"
613
606
with pytest .raises (TypeError , match = msg ):
614
607
DatetimeIndex ("1/1/2000" )
@@ -647,17 +640,6 @@ def test_constructor_coverage(self):
647
640
with pytest .raises (ValueError , match = msg ):
648
641
DatetimeIndex (["2000-01-01" , "2000-01-02" , "2000-01-04" ], freq = "D" )
649
642
650
- msg = (
651
- "Of the four parameters: start, end, periods, and freq, exactly "
652
- "three must be specified"
653
- )
654
- with pytest .raises (ValueError , match = msg ):
655
- date_range (start = "2011-01-01" , freq = "b" )
656
- with pytest .raises (ValueError , match = msg ):
657
- date_range (end = "2011-01-01" , freq = "B" )
658
- with pytest .raises (ValueError , match = msg ):
659
- date_range (periods = 10 , freq = "D" )
660
-
661
643
@pytest .mark .parametrize ("freq" , ["YS" , "W-SUN" ])
662
644
def test_constructor_datetime64_tzformat (self , freq ):
663
645
# see GH#6572: ISO 8601 format results in stdlib timezone object
@@ -762,10 +744,6 @@ def test_constructor_invalid_dtype_raises(self, dtype):
762
744
with pytest .raises (ValueError , match = msg ):
763
745
DatetimeIndex ([1 , 2 ], dtype = dtype )
764
746
765
- def test_constructor_name (self ):
766
- idx = date_range (start = "2000-01-01" , periods = 1 , freq = "YE" , name = "TEST" )
767
- assert idx .name == "TEST"
768
-
769
747
def test_000constructor_resolution (self ):
770
748
# 2252
771
749
t1 = Timestamp ((1352934390 * 1000000000 ) + 1000000 + 1000 + 1 )
@@ -921,9 +899,7 @@ def test_constructor_with_nonexistent_keyword_arg(self, warsaw):
921
899
tm .assert_index_equal (result , expected )
922
900
923
901
# nonexistent keyword in end
924
- end = Timestamp ("2015-03-29 02:30:00" ).tz_localize (
925
- timezone , nonexistent = "shift_forward"
926
- )
902
+ end = start
927
903
result = date_range (end = end , periods = 2 , freq = "h" )
928
904
expected = DatetimeIndex (
929
905
[
0 commit comments