Commit 29752bdd by 文鑫

Merge remote-tracking branch 'origin/master'

parents ffe0b706 c4311d0b
# _*_ coding:utf-8 _*_
_author_ = 'wenxin'
_date_ = '2020/6/15 14:57'
# _*_ coding:utf-8 _*_
_author_ = 'wenxin'
_date_ = '2020/6/16 16:49'
from common.getData import DoExcelByPandas
data = DoExcelByPandas().get_data_by_pandas('data.xlsx','Sheet1')
url = DoExcelByPandas().get_url_by_pandas('data.xlsx','Sheet1')
# print(data[0]['data'])
# print(type(data[0]['data']))
for i in data:
print(i)
# for i in url:
# print(i)
\ No newline at end of file
# _*_ coding:utf-8 _*_
_author_ = 'wenxin'
_date_ = '2020/6/17 11:12'
# content of test_time.py
import pytest
from datetime import datetime, timedelta
testdata = [
(datetime(2001, 12, 12), datetime(2001, 12, 11), timedelta(1)),
(datetime(2001, 12, 11), datetime(2001, 12, 12), timedelta(-1)),
]
@pytest.mark.parametrize("a,b,expected", testdata)
def test_timedistance_v0(a, b, expected):
diff = a - b
assert diff == expected
@pytest.mark.parametrize("a,b,expected", testdata, ids=["forward", "backward"])
def test_timedistance_v1(a, b, expected):
diff = a - b
assert diff == expected
def idfn(val):
if isinstance(val, (datetime,)):
# note this wouldn't show any hours/minutes/seconds
return val.strftime('%Y%m%d')
@pytest.mark.parametrize("a,b,expected", testdata, ids=idfn)
def test_timedistance_v2(a, b, expected):
diff = a - b
assert diff == expected
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment