File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
cirq-core/cirq/contrib/qcircuit Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 99
99
with :
100
100
python-version : ' 3.11'
101
101
architecture : ' x64'
102
+ - name : Install system packages
103
+ run : |
104
+ sudo apt-get update
105
+ sudo apt-get install latexmk texlive-latex-base texlive-latex-extra
102
106
- name : Install changed files test dependencies
103
107
run : dev_tools/conf/pip-install-minimal-for-pytest-changed-files.sh
104
108
- name : Changed files test
@@ -203,6 +207,10 @@ jobs:
203
207
cache-dependency-path : |
204
208
**/requirements.txt
205
209
dev_tools/requirements/**/*.txt
210
+ - name : Install system packages
211
+ run : |
212
+ sudo apt-get update
213
+ sudo apt-get install latexmk texlive-latex-base texlive-latex-extra
206
214
- name : Install requirements
207
215
run : |
208
216
pip install --upgrade setuptools wheel
@@ -263,6 +271,10 @@ jobs:
263
271
cache-dependency-path : |
264
272
**/requirements.txt
265
273
dev_tools/requirements/**/*.txt
274
+ - name : Install system packages
275
+ run : |
276
+ sudo apt-get update
277
+ sudo apt-get install latexmk texlive-latex-base texlive-latex-extra
266
278
- name : Install requirements
267
279
run : |
268
280
pip install --upgrade setuptools wheel
Original file line number Diff line number Diff line change 14
14
15
15
from __future__ import annotations
16
16
17
- from unittest import mock
18
-
19
- import pylatex
17
+ import pathlib
20
18
21
19
import cirq
22
20
import cirq .contrib .qcircuit .qcircuit_pdf as qcircuit_pdf
23
21
24
22
25
- @mock .patch .object (pylatex .Document , "generate_pdf" )
26
- def test_qcircuit_pdf (mock_generate_pdf ) -> None :
23
+ def test_qcircuit_pdf (tmp_path : pathlib .Path ) -> None :
27
24
circuit = cirq .Circuit (cirq .X (cirq .q (0 )), cirq .CZ (cirq .q (0 ), cirq .q (1 )))
28
- qcircuit_pdf .circuit_to_pdf_using_qcircuit_via_tex (circuit , "/tmp /test_file" )
29
- mock_generate_pdf . assert_called_once_with (
30
- "/tmp/ test_file" , compiler = "latexmk" , compiler_args = [ "-pdfps" ]
31
- )
25
+ qcircuit_pdf .circuit_to_pdf_using_qcircuit_via_tex (circuit , f" { tmp_path } /test_file" )
26
+ assert ( tmp_path / "test_file.pdf" ). is_file ()
27
+ assert not ( tmp_path / " test_file.dvi" ). exists ()
28
+ assert not ( tmp_path / "test_file.ps" ). exists ( )
You can’t perform that action at this time.
0 commit comments