git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Jun 6, 2018, 21:11 UTC
Message-ID
<dafabaf6-2cf7-6725-8524-9089776c31c3@jeffhostetler.com>
In-Reply-To
<20180606210300.GA1879@sigill.intra.peff.net>
On 6/6/2018 5:03 PM, Jeff King wrote:
Show 24 quoted lines
> On Wed, Jun 06, 2018 at 01:10:52PM -0400, Todd Zullinger wrote:
> 
>> git@jeffhostetler.com wrote:
>>> +# As a sanity check, ask Python to parse our generated JSON.  Let Python
>>> +# recursively dump the resulting dictionary in sorted order.  Confirm that
>>> +# that matches our expectations.
>>> +test_expect_success PYTHON 'parse JSON using Python' '
>> [...]
>>> +	python "$TEST_DIRECTORY"/t0019/parse_json_1.py <output.json >actual &&
>>
>> Would this be better using $PYTHON_PATH rather than
>> hard-coding python as the command?
> 
> Probably. We may want to go the same route as we did for perl in
> a0e0ec9f7d (t: provide a perl() function which uses $PERL_PATH,
> 2013-10-28) so that test writers don't have to remember this.
> 
> That said, I wonder if it would be hard to simply do the python bits
> here in perl. This is the first use of python in our test scripts (and
> really the only user in the whole code base outside of a few fringe
> commands). Leaving aside any perl vs python flame-war, I think there's
> value in keeping the number of languages limited when there's not a
> compelling reason to do otherwise.
> 

Perl works too. (I don't know perl, but I'm told it does work for stuff like this. :-)

I'll take a stab at it.
Jeff
Previous: Jeff KingNext: Ramsay Jones
Message 6 of 13 in “json-writer V7”
  1. 0/2 json-writer V7git@jeffhostetler.com, Jun 5, 2018
  2. 1/2 json_writer: new routines to create data in JSON formatgit@jeffhostetler.com, Jun 5, 2018
  3. 2/2 json-writer: t0019: add Python unit testgit@jeffhostetler.com, Jun 5, 2018
  4. Todd ZullingerJun 6, 2018
  5. Jeff KingJun 6, 2018
  6. Jeff HostetlerJun 6, 2018
  7. Ramsay JonesJun 7, 2018
  8. Todd ZullingerJun 7, 2018
  9. Jeff KingJun 7, 2018
  10. Jeff KingJun 7, 2018
  11. Jeff KingJun 7, 2018
  12. Ramsay JonesJun 7, 2018
  13. Jeff HostetlerJun 6, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.