Ipython: test_history μ‹€νŒ¨

에 λ§Œλ“  2018λ…„ 10μ›” 08일  Β·  16μ½”λ©˜νŠΈ  Β·  좜처: ipython/ipython

openSUSE 용 ipython 7.0.1을 νŒ¨ν‚€μ§€ν•˜λ €κ³ ν•˜λŠ”λ° λ‹¨μœ„ ν…ŒμŠ€νŠΈμ—μ„œ λ‹€μŒ 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.

======================================================================
FAIL: IPython.core.tests.test_history.test_history
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python3.6/site-packages/IPython/core/tests/test_history.py", line 113, in test_history
    newhist[3]])
AssertionError: Lists differ: [(1, [51 chars]rn test'), (1, 3, "b='β‚¬Γ†ΒΎΓ·ΓŸ'"), (2, 1, 'z=5'), (2, 3, "k='p'")] != [(1, [51 chars]rn test'), (1, 3, "b='β‚¬Γ†ΒΎΓ·ΓŸ'"), (2, 3, "k='p'"), (2, 4, 'z=5')]

First differing element 3:
(2, 1, 'z=5')
(2, 3, "k='p'")

  [(1, 1, 'a=1'),
   (1, 2, 'def f():\n    test = 1\n    return test'),
   (1, 3, "b='β‚¬Γ†ΒΎΓ·ΓŸ'"),
-  (2, 1, 'z=5'),
-  (2, 3, "k='p'")]
?                 ^

+  (2, 3, "k='p'"),
?                 ^

+  (2, 4, 'z=5')]
-------------------- >> begin captured stdout << ---------------------
def f():
    test = 1
    return test
b='β‚¬Γ†ΒΎΓ·ΓŸ'
The following commands were written to file `/tmp/tmphhgt1b7l/tmpsytny8bh/test4.py`:
a=1
def f():
    test = 1
    return test
b='β‚¬Γ†ΒΎΓ·ΓŸ'

--------------------- >> end captured stdout << ----------------------
    """Fail immediately, with the given message."""
>>  raise self.failureException('Lists differ: [(1, [51 chars]rn test\'), (1, 3, "b=\'β‚¬Γ†ΒΎΓ·ΓŸ\'"), (2, 1, \'z=5\'), (2, 3, "k=\'p\'")] != [(1, [51 chars]rn test\'), (1, 3, "b=\'β‚¬Γ†ΒΎΓ·ΓŸ\'"), (2, 3, "k=\'p\'"), (2, 4, \'z=5\')]\n\nFirst differing element 3:\n(2, 1, \'z=5\')\n(2, 3, "k=\'p\'")\n\n  [(1, 1, \'a=1\'),\n   (1, 2, \'def f():\\n    test = 1\\n    return test\'),\n   (1, 3, "b=\'β‚¬Γ†ΒΎΓ·ΓŸ\'"),\n-  (2, 1, \'z=5\'),\n-  (2, 3, "k=\'p\'")]\n?                 ^\n\n+  (2, 3, "k=\'p\'"),\n?                 ^\n\n+  (2, 4, \'z=5\')]')


----------------------------------------------------------------------

λ§ˆμ§€λ§‰ 두 λͺ©λ‘ μš”μ†Œκ°€ μž₯μ†Œλ₯Ό λ°”κΎΌ κ²ƒμ²˜λŸΌ λ³΄μ΄μ§€λ§Œ κ·Έ 이유λ₯Ό λͺ¨λ₯΄κ² μŠ΅λ‹ˆλ‹€.


νŽΈμ§‘ν•˜λ‹€:

이 λ¬Έμ œλŠ” 두 λ‹¨κ³„λ‘œ ν•΄κ²°ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

1) 영ν–₯μ„λ°›λŠ” κ²ƒμœΌλ‘œ λ³΄μ΄λŠ” sqlite 버전 λ²”μœ„μ— λŒ€ν•΄ ν…ŒμŠ€νŠΈλ₯Ό κ±΄λ„ˆ λ›°κΈ° (λ˜λŠ” μ•Œλ €μ§„ μ‹€νŒ¨)둜 ν‘œμ‹œν•©λ‹ˆλ‹€.
2) 이것이 κ³ μΉ  κ°€μΉ˜κ°€μžˆλŠ” ν–‰λ™μ˜ 변화인지 μ•„λ‹ˆλ©΄ ν…ŒμŠ€νŠΈκ°€ 그에 따라 μ—…λ°μ΄νŠΈλ˜μ–΄μ•Όν•˜λŠ”μ§€ μ‹€μ œλ‘œ νŒŒμ•…ν•©λ‹ˆλ‹€.

Hacktoberfest help wanted

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

λ‚˜λŠ” IPython μ½”λ“œλ² μ΄μŠ€μ— 밑쀄이 μ—†λ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€.

예λ₯Ό λ“€λ©΄ κ±°κΈ° .

@dsblank RipGrep 을 μ‚¬μš©ν•΄ λ³΄μ…¨μŠ΅λ‹ˆκΉŒ ? 정말 μ’‹μŠ΅λ‹ˆλ‹€ : 기본적으둜 .git κ±΄λ„ˆ λ›°κΈ°, 기본적으둜 μž¬κ·€ 검색, 색상 κ°•μ‘° ν‘œμ‹œ, 파일 μœ ν˜•λ³„ 필터링. python νŒŒμΌμ—μ„œλ§Œ skipifλ₯Ό κ²€μƒ‰ν•˜λŠ” 예제 :

$ rg <strong i="11">@skipif</strong> -tpy
IPython/extensions/tests/test_autoreload.py
133:    @skipif(sys.version_info < (3, 6))

IPython/core/tests/test_interactiveshell.py
531:    @skipif(not hasattr(signal, 'SIGALRM'))

IPython/lib/tests/test_latextools.py
47:<strong i="12">@skipif_not_matplotlib</strong>
62:<strong i="13">@skipif_not_matplotlib</strong>

IPython/lib/tests/test_display.py
182:<strong i="14">@skipif_not_numpy</strong>
 ~/dev/ipython[master βœ—] $ rg <strong i="15">@skip_if</strong> -tpy
IPython/lib/tests/test_clipboard.py
7:<strong i="16">@skip_if_no_x11</strong>

IPython/utils/tests/test_path.py
102:<strong i="17">@skip_if_not_win32</strong>
117:<strong i="18">@skip_if_not_win32</strong>
157:<strong i="19">@skip_if_not_win32</strong>
377:    <strong i="20">@skip_if_not_win32</strong>
468:    <strong i="21">@skip_if_not_win32</strong>

... λ‚΄ μ»΄ν“¨ν„°μ—μ„œ 10 λ°° 더 λΉ λ¦…λ‹ˆλ‹€.

λͺ¨λ“  16 λŒ“κΈ€

μ–΄λ–€ λ²„μ „μ˜ Python을 μ‹€ν–‰ν•˜κ³  μžˆμŠ΅λ‹ˆκΉŒ? sqlite 버전도 μ‚΄νŽ΄λ³΄μ‹­μ‹œμ˜€.

λ‹€μŒμ€ python 및 sqlite λ²„μ „μž…λ‹ˆλ‹€.

libsqlite3-0-3.25.0-1.1
python3-3.6.5-3.4

그리고 λ‹€λ₯Έ μΌλΆ€λŠ” κ΄€λ ¨μ΄μžˆμ„ 수 μžˆμŠ΅λ‹ˆλ‹€.

bash-4.4-107.1
coreutils-8.30-1.2
gcc8-8.2.1+r264010-1.1
gettext-runtime-mini-0.19.8.1-9.1
gettext-tools-mini-0.19.8.1-9.1
glibc-2.27-6.1
libdb-4_8-4.8.30-36.5
libgdbm5-1.14.1-1.6
libgdbm_compat4-1.14.1-1.6
libncurses6-6.1-6.5
libreadline7-7.0-2.1
libstdc++6-8.2.1+r264010-1.1
libzmq5-4.2.5-2.1
linux-glibc-devel-4.18-1.1
ncurses-utils-6.1-6.5
python3-ipython_genutils-0.2.0-2.1
python3-jedi-0.12.1-1.1
python3-jsonschema-2.6.0-2.2
python3-jupyter_client-5.2.3-4.1
python3-jupyter_core-4.4.0-3.1
python3-jupyter_ipyparallel-6.2.2-6.27
python3-jupyter_ipywidgets-7.4.2-10.1
python3-jupyter_nbconvert-5.4.0-15.11
python3-jupyter_nbformat-4.4.0-3.1
python3-jupyter_notebook-5.7.0-8.3
python3-jupyter_qtconsole-4.4.1-5.2
python3-jupyter_widgetsnbextension-3.4
python3-nose-1.3.7-10.1
python3-pexpect-4.6.0-2.1
python3-pyparsing-2.2.0-2.1
python3-pyzmq-17.1.2-1.1
python3-setuptools-40.4.3-1.1
python3-simplegeneric-0.8.1-8.4
python3-simplejson-3.16.1-1.1
python3-six-1.11.0-4.1
python3-terminado-0.8.1-3.1
python3-testpath-0.4.1-4.1
python3-traitlets-4.3.2-4.1
python3-wcwidth-0.1.7-2.1

이 λ¬Έμ œλŠ” 버전 6.5μ—μ„œλ„ λ°œμƒν•˜λŠ” κ²ƒμœΌλ‘œ λ³΄μž…λ‹ˆλ‹€. sqlite3 3.24.0μ—μ„œ 3.25.0으둜 μ „ν™˜ν–ˆμ„ λ•Œ λ¬Έμ œκ°€ 처음 λ°œμƒν•œ 것 κ°™μŠ΅λ‹ˆλ‹€.

μ‹€μ œλ‘œ z=5 의 경우 νŠœν”Œμ˜ 두 번째 μˆ«μžκ°€ λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€. line number (AFAICT)μž…λ‹ˆλ‹€.

그럼 μ™œ 1 λŒ€μ‹  4 ...? μš°λ¦¬κ°€ unique μš”μ²­ν•  λ•Œ μš°λ¦¬λŠ” 3 번째 열에 uniq wrt 만 μš”μ²­ν•˜κ³  sqliteλŠ” μ •λ ¬ν•˜κΈ° 전에 λ‚΄λΆ€ λ™μž‘μ„ λ³€κ²½ν•˜κ³  uniquifyν•˜μ—¬ z=5 ?

λ‚˜λŠ” 그것을 놓쳀닀. ν•˜μ§€λ§Œ μ €λŠ” SQL에 λŒ€ν•΄ 아무것도 λͺ¨λ₯΄κΈ° λ•Œλ¬Έμ— μ™œ 그런 일이 일어날 지 λͺ¨λ₯΄κ² μŠ΅λ‹ˆλ‹€. μ΅œμ‹  버전 인 sqlite 3.25.2μ—μ„œ μ—¬μ „νžˆ λ¬Έμ œκ°€ λ°œμƒ 함을 ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€.

λ‚˜λ„ SQL μ „λ¬Έκ°€κ°€ μ•„λ‹™λ‹ˆλ‹€. ν…ŒμŠ€νŠΈ μ‹€νŒ¨κ°€ μ•„λ‹ˆλΌκ³  말할 수 μžˆμŠ΅λ‹ˆλ‹€.
μœ„λ…ν•œ. "μ•Œλ €μ§„ μ‹€νŒ¨"λ§ˆμ»€κ°€ openSUSE 용으둜 νŒ¨ν‚€μ§•ν•˜λŠ” 데 λ„μ›€μ΄λ©λ‹ˆκΉŒ?
κ·Όλ³Έ 원인을 μ°ΎλŠ” 것을 μ„ ν˜Έν•˜μ‹­λ‹ˆκΉŒ?

μΌμš”μΌ, 2018 λ…„ 10 μ›” 14 일, 12:28 Todd [email protected] μž‘μ„± :

λ‚˜λŠ” 그것을 놓쳀닀. ν•˜μ§€λ§Œ μ €λŠ” SQL에 λŒ€ν•΄ 아무것도 λͺ°λΌμ„œ λͺ¨λ₯΄κ² μŠ΅λ‹ˆλ‹€.
μ™œ 일어날 수 μžˆλŠ”μ§€. λ¬Έμ œκ°€ μ—¬μ „νžˆ λ°œμƒν•˜λŠ”μ§€ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€.
sqlite 3.25.2, μ΅œμ‹  버전.

β€”
λŒ“κΈ€μ„ λ‹¬μ•˜ κΈ° λ•Œλ¬Έμ— μˆ˜μ‹  ν•œ κ²ƒμž…λ‹ˆλ‹€.
이 이메일에 직접 λ‹΅μž₯ν•˜κ³  GitHubμ—μ„œ ν™•μΈν•˜μ„Έμš”.
https://github.com/ipython/ipython/issues/11372#issuecomment-429654816 ,
λ˜λŠ” μŠ€λ ˆλ“œ μŒμ†Œκ±°
https://github.com/notifications/unsubscribe-auth/AAUez9oGI6J02rTiDIfuzUCrpY71axO9ks5uk5B1gaJpZM4XMOVJ
.

버그가 μ–Όλ§ˆλ‚˜ μ‹¬κ°ν•œ 지 λͺ¨λ₯΄κ² μœΌλ―€λ‘œ κ·€ν•˜μ˜ νŒλ‹¨μ„ λ―Έλ£¨κ² μŠ΅λ‹ˆλ‹€. λ¬Όλ‘  μ‹€μ œ μˆ˜μ •μ΄ λ°”λžŒμ§ν•˜μ§€λ§Œ λ¬Έμ œκ°€ μΆ©λΆ„νžˆ μ‚¬μ†Œν•˜λ‹€κ³  μƒκ°λ˜λ©΄ λ‹ΉλΆ„κ°„ μ•Œλ €μ§„ μ‹€νŒ¨λ‘œ 갈 수 μžˆμŠ΅λ‹ˆλ‹€.

@LucianaMarques 당신은 μ‰¬μš΄ 것을 μ°Ύκ³  μžˆμ—ˆλŠ”λ°, 그것은 λ„ˆλ¬΄ 어렡지 μ•Šμ„ κ²ƒμž…λ‹ˆλ‹€. sqlite3.sqlite_version_info > (x, y, z) 와 같은 쑰건으둜 "@skip_if"λ₯Ό μΆ”κ°€ν•˜κΈ°

λ‚˜μ€‘μ— μˆ˜μ •μ„ μ—°κΈ° ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

@Carreau κ°μ‚¬ν•©λ‹ˆλ‹€, 였늘 μ‹œλ„ν•΄ λ³Όκ²Œμš”!

당신이 μ–΄λ–€ μžμŠ΅μ„œ / μ›Œλ“œ ν”„λ‘œμ„Έμ„œ ꢌμž₯ 사항이 μžˆμŠ΅λ‹ˆκΉŒ, @Carreau λ‚΄κ°€ μ‚¬μš© @skip_if에 λ¬Έμ œκ°€μžˆμ–΄, λ‚˜λŠ” 그것을 μ‚¬μš©ν•œ μ μ΄κ³Όμ—λŠ” λ¬Έμ„œλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€ (λ˜λŠ” λ‚˜λŠ” ... μ œλŒ€λ‘œ 검색 μ•„λ‹ˆμ—μš”)?

@LucianaMarques μƒˆλ‘œμš΄ μ˜μ—­μ—μ„œ 코딩을 μ‹œμž‘ν•  λ•Œλ§ˆλ‹€ ν˜„μž¬ μ½”λ“œμ—μ„œ 예제λ₯Ό 찾으렀고 λ…Έλ ₯ν•©λ‹ˆλ‹€. Unix 기반 μ‹œμŠ€ν…œμ„ μ‚¬μš©ν•˜λŠ” 경우 grep λ₯Ό μ‚¬μš©ν•˜μ—¬ μ½”λ“œλ² μ΄μŠ€μ—μ„œ "skip_if"의 예λ₯Ό κ²€μƒ‰ν•˜κ³  μœ μΆ”ν•˜μ—¬ ν˜„μž¬ λ¬Έμ œμ— 적용 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‚˜λŠ” IPython μ½”λ“œλ² μ΄μŠ€μ— 밑쀄이 μ—†λ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€.

예λ₯Ό λ“€λ©΄ κ±°κΈ° .

@dsblank RipGrep 을 μ‚¬μš©ν•΄ λ³΄μ…¨μŠ΅λ‹ˆκΉŒ ? 정말 μ’‹μŠ΅λ‹ˆλ‹€ : 기본적으둜 .git κ±΄λ„ˆ λ›°κΈ°, 기본적으둜 μž¬κ·€ 검색, 색상 κ°•μ‘° ν‘œμ‹œ, 파일 μœ ν˜•λ³„ 필터링. python νŒŒμΌμ—μ„œλ§Œ skipifλ₯Ό κ²€μƒ‰ν•˜λŠ” 예제 :

$ rg <strong i="11">@skipif</strong> -tpy
IPython/extensions/tests/test_autoreload.py
133:    @skipif(sys.version_info < (3, 6))

IPython/core/tests/test_interactiveshell.py
531:    @skipif(not hasattr(signal, 'SIGALRM'))

IPython/lib/tests/test_latextools.py
47:<strong i="12">@skipif_not_matplotlib</strong>
62:<strong i="13">@skipif_not_matplotlib</strong>

IPython/lib/tests/test_display.py
182:<strong i="14">@skipif_not_numpy</strong>
 ~/dev/ipython[master βœ—] $ rg <strong i="15">@skip_if</strong> -tpy
IPython/lib/tests/test_clipboard.py
7:<strong i="16">@skip_if_no_x11</strong>

IPython/utils/tests/test_path.py
102:<strong i="17">@skip_if_not_win32</strong>
117:<strong i="18">@skip_if_not_win32</strong>
157:<strong i="19">@skip_if_not_win32</strong>
377:    <strong i="20">@skip_if_not_win32</strong>
468:    <strong i="21">@skip_if_not_win32</strong>

... λ‚΄ μ»΄ν“¨ν„°μ—μ„œ 10 λ°° 더 λΉ λ¦…λ‹ˆλ‹€.

@Carreau 및 @dsblank κ°μ‚¬ν•©λ‹ˆλ‹€. κ·€ν•˜μ˜ μ œμ•ˆμ€ 정말 λ„μ›€μ΄λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 이전에이 λͺ…령에 μ΅μˆ™ν•˜μ§€ μ•Šμ€ 것 κ°™μŠ΅λ‹ˆλ‹€.

곧 ν’€ λ¦¬ν€˜μŠ€νŠΈλ‘œ λŒμ•„ μ˜¬κ²Œμš”.

μ•½μ†λŒ€λ‘œ λ‚΄ pull request .

Skip_ifκ°€ μΆ”κ°€λ˜μ—ˆμœΌλ―€λ‘œ 문제의 μ›μΈμœΌλ‘œ μ΄λ™ν•˜κΈ° μœ„ν•΄μ΄ ν•­λͺ©μ„ μ—΄μ–΄ λ‘κ² μŠ΅λ‹ˆλ‹€.

감사 !

ν–₯ν›„ μ°Έμ‘° 및 μ–Έμ  κ°€ μ‹€μ œ μˆ˜μ •μ„ μœ„ν•΄ ipython이 SQL "GROUP BY"μ ˆμ„ μ‚¬μš©ν•˜μ—¬ 쀑볡을 μŠ€μΏΌμ‹œν•˜λŠ” λ™μ‹œμ— κ·Έλ£Ήν™” 열도 μ•„λ‹ˆκ³  집계 ν•¨μˆ˜ (μ„Έμ…˜ 및 쀄)도 μ•„λ‹Œ 열을 κΈ°μ€€μœΌλ‘œ μ„ νƒν•˜κ³  μ •λ ¬ν•˜κΈ° λ•Œλ¬Έμ— 이런 일이 λ°œμƒν•˜λŠ” κ²ƒμœΌλ‘œ λ³΄μž…λ‹ˆλ‹€. SQLκ³Ό sqlite λͺ¨λ‘ μ†Œμœ„ "bare"열에 λŒ€ν•œ 값이 κ·Έλ € 질 각 κ²°κ³Ό 그룹의 행을 μ§€μ •ν•˜μ§€ μ•ŠμœΌλ©° κ·Έ μ μ—μ„œ sqlite의 μ‹€μ œ λ™μž‘μ΄ λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

sqlite3 3.26.0에 λŒ€ν•΄ μ„±κ³΅ν•˜μ§€ λͺ»ν•œ 채 생성 된 SQL에 λͺ‡ 가지 λ³€ν˜•μ„ μ‹œλ„ν–ˆμŠ΅λ‹ˆλ‹€. ν™•μ‹€νžˆ ν•  μˆ˜μžˆλŠ” 방법이 μžˆμ§€λ§Œ ν•„μš”ν•œ λ³€κ²½μ˜ 규λͺ¨μ™€ 검색 μ„±λŠ₯에 λ―ΈμΉ˜λŠ” 영ν–₯에 λŒ€ν•œ 질문이 μžˆμŠ΅λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰